Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2927: Blocked from starting a new domain request when there are other started domain requests - [MEOWARD] #3017

Merged
merged 35 commits into from
Nov 14, 2024

Conversation

zandercymatics
Copy link
Contributor

@zandercymatics zandercymatics commented Nov 1, 2024

Ticket

Resolves #2927

Changes

  • Changes the DomainRequestWizard such that the domain request flow now takes an id in the url path, rather than in the session
  • Fixes existing tests on the domain request page to pass in an id
  • Adds a breadcrumb to the first page of the domain request flow (such that you can go back to the home page), and kept the old back button on the rest

Context for reviewers

Context for design:
The only design change is a breadcrumb on the first page of the domain request flow. This exists on the non-org view as well.

General context:
This bug was happening because the original DomainRequestWizard was actually storing the domain request id and the "new_request" variable in the session. Because our session is in our database as a CacheTable, this meant that you could override the session state by taking other actions in another tab.

The fix for this is to simply expose the domain request id in the actual url itself, rather than relying on session to store this information for us.

Because we are now removing the id, this does reintroduce the back button bug. It was decided that this would be resolved with a new design, so a breadcrumb has also been added to the first step of the domain request flow.

Setup

(devs only) You can reproduce the original bug on another sandbox by doing the following:

  1. Open the app in two tabs (or two browsers)
  2. On one of the tabs, start a new domain request and complete some of it. Stop midway through.
  3. On the other tab, click start a new domain request again. Either one of two things will happen, depending on the order in which you complete these steps: the request will look like its already filled out, or the request on your original tab will lose its progress (you will need to click on another step to trigger another get or post)

For this ticket, follow these same steps on getgov-meoward. This behavior should now no longer exist.

To test the new breadcrumb (both portfolio and non portfolio:

  1. Start a new domain request, and note the breadcrumb on the first step
  2. Go to the second step. Note the old context.

Code Review Verification Steps

As the original developer, I have

Satisfied acceptance criteria and met development standards

  • Met the acceptance criteria, or will meet them in a subsequent PR
  • Created/modified automated tests
  • Update documentation in READMEs and/or onboarding guide

Ensured code standards are met (Original Developer)

  • If any updated dependencies on Pipfile, also update dependencies in requirements.txt.
  • Interactions with external systems are wrapped in try/except
  • Error handling exists for unusual or missing values

Validated user-facing changes (if applicable)

  • Tag @dotgov-designers in this PR's Reviewers for design review. If code is not user-facing, delete design reviewer checklist
  • Verify new pages have been added to .pa11yci file so that they will be tested with our automated accessibility testing
  • Checked keyboard navigability
  • Tested general usability, landmarks, page header structure, and links with a screen reader (such as Voiceover or ANDI)

As a code reviewer, I have

Reviewed, tested, and left feedback about the changes

  • Pulled this branch locally and tested it
  • Verified code meets all checks above. Address any checks that are not satisfied
  • Reviewed this code and left comments. Indicate if comments must be addressed before code is merged
  • Checked that all code is adequately covered by tests
  • Verify migrations are valid and do not conflict with existing migrations - NA

Validated user-facing changes as a developer

Note: Multiple code reviewers can share the checklists above, a second reviewer should not make a duplicate checklist. All checks should be checked before approving, even those labeled N/A.

  • New pages have been added to .pa11yci file so that they will be tested with our automated accessibility testing
  • Checked keyboard navigability
  • Meets all designs and user flows provided by design/product
  • Tested general usability, landmarks, page header structure, and links with a screen reader (such as Voiceover or ANDI)
  • (Rarely needed) Tested as both an analyst and applicant user - NA

As a designer reviewer, I have

Verified that the changes match the design intention

  • Checked that the design translated visually
  • Checked behavior. Comment any found issues or broken flows.
  • Checked different states (empty, one, some, error)
  • Checked for landmarks, page heading structure, and links

Validated user-facing changes as a designer

  • Checked keyboard navigability
  • Tested general usability, landmarks, page header structure, and links with a screen reader (such as Voiceover or ANDI)
  • Tested with multiple browsers (check off which ones were used)
    • Chrome
    • Microsoft Edge
    • FireFox
    • Safari
  • (Rarely needed) Tested as both an analyst and applicant user

References

Screenshots

image

Copy link

github-actions bot commented Nov 1, 2024

🥳 Successfully deployed to developer sandbox za.

Copy link

github-actions bot commented Nov 1, 2024

🥳 Successfully deployed to developer sandbox za.

@zandercymatics zandercymatics changed the title [DRAFT] #2927: Bug - blocked from starting requests [DRAFT] #2927: Bug - blocked from starting requests - [MEOWARD] Nov 1, 2024
Copy link

github-actions bot commented Nov 1, 2024

🥳 Successfully deployed to developer sandbox za.

Copy link

github-actions bot commented Nov 1, 2024

🥳 Successfully deployed to developer sandbox za.

Copy link

github-actions bot commented Nov 1, 2024

🥳 Successfully deployed to developer sandbox za.

Copy link

github-actions bot commented Nov 4, 2024

🥳 Successfully deployed to developer sandbox za.

Copy link

github-actions bot commented Nov 4, 2024

🥳 Successfully deployed to developer sandbox za.

Copy link

github-actions bot commented Nov 4, 2024

🥳 Successfully deployed to developer sandbox za.

Copy link

github-actions bot commented Nov 4, 2024

🥳 Successfully deployed to developer sandbox za.

Copy link

github-actions bot commented Nov 4, 2024

🥳 Successfully deployed to developer sandbox za.

Copy link

github-actions bot commented Nov 6, 2024

🥳 Successfully deployed to developer sandbox za.

Copy link

github-actions bot commented Nov 6, 2024

🥳 Successfully deployed to developer sandbox za.

Copy link

github-actions bot commented Nov 7, 2024

🥳 Successfully deployed to developer sandbox za.

Copy link

github-actions bot commented Nov 7, 2024

🥳 Successfully deployed to developer sandbox za.

Copy link

github-actions bot commented Nov 7, 2024

🥳 Successfully deployed to developer sandbox za.

1 similar comment
Copy link

github-actions bot commented Nov 7, 2024

🥳 Successfully deployed to developer sandbox za.

@zandercymatics zandercymatics changed the title [DRAFT] #2927: Blocked from starting a new domain request when there are other started domain requests - [MEOWARD] #2927: Blocked from starting a new domain request when there are other started domain requests - [MEOWARD] Nov 7, 2024
Copy link

github-actions bot commented Nov 7, 2024

🥳 Successfully deployed to developer sandbox za.

@erinysong erinysong self-assigned this Nov 7, 2024
@erinysong
Copy link
Contributor

erinysong commented Nov 7, 2024

Tested the following:

  1. Created a new domain request, filled form up to senior official and exited back to home page. image
  2. Click on create a domain request button and was directed to a blank new form with a new session id
image 3. When I go back to my original incompleted domain request in step 1, I am redirected back to the first domain request with its progress maintained where I last left the domain request form image

Copy link
Contributor

@erinysong erinysong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified and tested ACs + code LGTM! Just had two small questions and can approve afterwards

domain_request_urls = [
path("", views.DomainRequestWizard.as_view(), name=""),
path("", RedirectView.as_view(pattern_name="domain-request:start"), name="redirect-to-start"),
path("start/", views.DomainRequestWizard.as_view(), name="start"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@@ -182,7 +183,9 @@ def configure_step_options(self):

def has_pk(self):
"""Does this wizard know about a DomainRequest database record?"""
return "domain_request_id" in self.storage
if self.kwargs.get("id") is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this work the same if we one liner this to return self.kwargs.get("id") or return self.kwargs.get("id") is not None?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great suggestion! The is not None one liner should return the same thing

@@ -493,6 +493,7 @@ def get_context_data(self):
# Hides the requests and domains buttons in the navbar
context_stuff["hide_requests"] = self.is_portfolio
context_stuff["hide_domains"] = self.is_portfolio
context_stuff["domain_request_id"] = self.domain_request.id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is for pre-existing code not in scope, but thoughts on renaming this variable to form_context or something along the lines of that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about context? I'm not opposed to doing that, I was thinking the same thing

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just context also works! Glad we were in agreement 🎉

Copy link

github-actions bot commented Nov 8, 2024

🥳 Successfully deployed to developer sandbox za.

Copy link
Contributor

@erinysong erinysong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚢

@Katherine-Osos Katherine-Osos removed the request for review from a team November 13, 2024 22:54
Copy link
Contributor

@Katherine-Osos Katherine-Osos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@zandercymatics zandercymatics merged commit 764ad7a into main Nov 14, 2024
8 of 10 checks passed
@zandercymatics zandercymatics deleted the za/2927-blocked-from-starting-requests branch November 14, 2024 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blocked from starting a new domain request when there are other started domain requests
3 participants